package com.sree.tali.common;

import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import org.apache.struts.upload.FormFile;

public class CommonUtils
{
  public void UploadFile(FormFile paramFormFile, String paramString)
  {
    File localFile1 = new File(paramString);
    if (!localFile1.exists()) {
      localFile1.mkdir();
    }
    String str = paramFormFile.getFileName();
    if (!"".equals(str))
    {
      System.out.println("Server path:" + paramString);
      File localFile2 = new File(paramString, str);
      if (localFile2.exists()) 
      localFile2.delete();
      //if (!localFile2.exists()) {
        try
        {
          FileOutputStream localFileOutputStream = new FileOutputStream(localFile2);
          localFileOutputStream.write(paramFormFile.getFileData());
          localFileOutputStream.flush();
          localFileOutputStream.close();
        }
        catch (Exception localException)
        {
          System.out.println(localException);
        }
      //}
    }
  }
}



/* Location:           D:\sreenu\talivud-new-110514\talivud-new\dist\WEB-INF\classes\

 * Qualified Name:     com.sree.tali.common.CommonUtils

 * JD-Core Version:    0.7.0.1

 */